package dao.pojo;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.TableGenerator;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * TGroupmember entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "t_groupmember", catalog = "cloud_ifw")
public class GroupMember extends BasePojo implements java.io.Serializable {

	// Fields

	private Integer id;
	private Group group;
	private User user;

	// Constructors

	/** default constructor */
	public GroupMember() {
	}


	// Property accessors
	@Id 
    @TableGenerator(name = "GROUPMEMBER_GEN", table = "sequence", pkColumnName = "SEQ_NAME", valueColumnName = "SEQ_COUNT", pkColumnValue = "SEQ_GROUPMEMBER", allocationSize = 1)
	@GeneratedValue(strategy = GenerationType.TABLE, generator = "GROUPMEMBER_GEN")
    @Column(name="id", unique=true, nullable=false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "groupid")
	public Group getGroup() {
		return this.group;
	}

	public void setGroup(Group group) {
		this.group = group;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "userid")
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}
	public Object getEntityId() {
		return this.id;
	}
}